#pragma warning disable 0618
using System;
using System.Collections.Generic;
using Table.DataModel;
namespace Table.Dao
{
    public class TableDeviceSupportDao:DaoBase<TableDeviceSupport>
    {
        public override string GetFileName()
        {
            return "TableDeviceSupport.csv";
        }
        public override void BuildIndex()
        {
            if (cacheList != null)
            {
                cachePrimary = new Dictionary<string, TableDeviceSupport>(cacheList.Count);
            }
            base.BuildIndex();
        }
        public override void AddPrimaryIndex(TableDeviceSupport model)
        {
            #if UNITY_EDITOR
            if(cachePrimary.ContainsKey(model.deviceId)) UnityEngine.Debug.LogError("数据表id重复:TableDeviceSupport->id: " + model.deviceId);
            #endif
            cachePrimary[model.deviceId] = model;
        }
        protected override TableDeviceSupport ParseRowData(string[] rowData)
        {
            TableDeviceSupport data = new TableDeviceSupport();
            if (!string.IsNullOrEmpty(rowData[0]))
            {
                data.deviceId = rowData[0];
            }
            if (!string.IsNullOrEmpty(rowData[1]))
            {
                data.msaaSupport = int.Parse(rowData[1]);
            }
            return data;
        }
    }
}
